﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PubAds.aspx.cs" Inherits="CNVP.JShop.Web.Admin.PubAds" %>
<%@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
            <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
        <meta content="IE=7" http-equiv="X-UA-Compatible" />
     <link href="CSS/Edit.css" rel="stylesheet" type="text/css" />
     <script src="../Scripts/jquery.js" type="text/javascript"></script>
     <script src="../Scripts/Common.js" type="text/javascript"></script>
    <script type ="text/javascript">
        $(function () {
            $("#btUp").click(function () {
                var $txtAdName = $("#txtAdName");
                var $ddlAdClassID = $("#ddlAdClassID");
                if ($ddlAdClassID.val() == "0") {
                    alert("请选择类别！");
                    $ddlAdClassID.focus();
                    return false;
                }
                if ($txtAdName.val() == "") {
                    alert("请输入名称！");
                    $txtAdName.focus();
                    return false;
                }
                var $txtAdAddress = $("#txtAdAddress");
                if (!IsValidURL($txtAdAddress.val())) {
                    alert("链接地址格式不正确！");
                    $txtAdAddress.focus();
                    return false;
                }
                var $txtOrderID = $("#txtOrderID");
                if ($txtOrderID.val() == "") {
                    alert("请输入排序！");
                    $txtOrderID.focus();
                    return false;
                }
                else if (!IsInteger($txtOrderID.val())) {
                    alert("排序格式不正确！");
                    $txtOrderID.focus();
                    return false;
                }
            });
        })
        function IsType() {
            var rblIsType = $("input[name='rblIsType']:checked").val();
            if (rblIsType == "1") {
                $(".AdSize").css("display", "");
                $(".AdPic").css("display", "");
                $(".PicOldName").css("display", "");
            }
            else {
                $(".AdSize").css("display", "none");
                $(".AdPic").css("display", "none");
                $(".PicOldName").css("display", "none");
            }
        }
   </script>
</head>
<body onload="IsType()">
    <form id="form1" runat="server">
       <div class="Content">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="cell">
                <tr>
                    <td class="cell_group">
                        <img src="Images/ListIconTitle.jpg" alt="" />&nbsp;您的位置：<a href="AdList.aspx">广告管理</a><asp:Label ID="lbTitle" runat="server"></asp:Label>
                    </td>
                </tr>
                </table>
                     <table border="0" cellpadding="0" cellspacing="0" class="division">
                        <tr>
                            <th>
                                  广告类型:</th>
                            <td>
                                  <asp:RadioButtonList ID="rblIsType" runat="server" 
                                      CssClass="RadioButtonListTable" RepeatDirection="Horizontal" Width="120px">
                                    <asp:ListItem Value="1" Selected="True">图像</asp:ListItem>
                                    <asp:ListItem  Value="0">文本</asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                        </tr>
                         <tr>
                            <th>
                                  分&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;类:</th>
                            <td>
                                 <asp:DropDownList ID="ddlAdClassID" runat="server" Width="150px">
                                    <asp:ListItem Value="0">--请选择--</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                        </tr>
                        <tr>
                            <th>
                                 名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称:</th>
                            <td>
                                 <asp:TextBox ID="txtAdName" runat="server" MaxLength="50" Width="355px" />
                                </td>
                        </tr>
                        <tr>
                            <th>
                                 链接地址:</th>
                            <td>
                                 <asp:TextBox ID="txtAdAddress" runat="server" MaxLength="255" Width="355px" Text="http://" />
                                </td>
                        </tr>
                        <tr class="AdPic">
                            <th>
                                 广告图片:</th>
                            <td>
                                 <asp:FileUpload ID="fileUp" runat="server" />&nbsp;
                                 <br />
                                <a href ="<%=picOriginal %>" target="_blank"><asp:Image ID="imgPic" runat="server" CssClass="ClassAdName" Visible="false" /></a>
                                </td>
                        </tr>
                        <tr class="PicOldName">
                             <th>
                                 地址图片:</th>
                            <td>
                                <asp:TextBox ID="txtPicOldName" runat="server" MaxLength="255" Width="355px" ></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                  显&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;示:</th>
                            <td>
                                  <asp:RadioButtonList ID="rblIsShow" runat="server" 
                                      CssClass="RadioButtonListTable" RepeatDirection="Horizontal" Width="100px">
                                    <asp:ListItem Value="1" Selected="True">是</asp:ListItem>
                                    <asp:ListItem  Value="0">否</asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                        </tr>
                        <tr>
                            <th>
                                 排&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;序:</th>
                            <td>
                                  <asp:TextBox ID="txtOrderID" runat="server" MaxLength="50" Text="0" />
                                </td>
                        </tr>
                    </table>
            <h3 onclick="IsShowFCK()">广告描述(<font color="red" style="cursor:pointer">打开请点击</font>)</h3>
                                    <table border="0" cellpadding="0" cellspacing="0" class="division" >
                                        <tbody id="divisionFCKeditor" style=" display:none;">
                                        <tr>
                                            <td>
                                                    <FCKeditorV2:FCKeditor ID="txtAdDetail" runat="server" Height="500px">
                                                    </FCKeditorV2:FCKeditor>

                                                </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                <asp:CheckBox ID="cbFCKeditorIsShow" runat="server" CssClass="Display" />
                                <script type="text/javascript">
                                    function IsShowFCK() {
                                        var cbFCKeditorIsShow = document.getElementById("cbFCKeditorIsShow");
                                        if (cbFCKeditorIsShow.checked == true) {
                                            cbFCKeditorIsShow.checked = false;
                                            $("#divisionFCKeditor").css("display", "none");
                                        }
                                        else {
                                            cbFCKeditorIsShow.checked = true;
                                            $("#divisionFCKeditor").css("display", "");
                                        }
                                    }
                                </script>
            <div class="EditBtn">  
            <asp:Button ID="btUp" runat="server" Text="提交" OnClick="btUp_Click" />
            <input type="button" value="取消" onclick="javascript:history.go(-1)" />
            </div>
        </div>
        <script type="text/javascript">
            ImgSize("ClassAdName", 400, 300);
      </script>
    </form>
</body>
</html>

